package cn.iocoder.yudao.module.contract.dal.mysql.client;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.contract.dal.dataobject.client.ClientDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.contract.controller.admin.client.vo.*;

/**
 * 客户 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ClientMapper extends BaseMapperX<ClientDO> {

    default PageResult<ClientDO> selectPage(ClientPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClientDO>()
                .likeIfPresent(ClientDO::getClientCode, reqVO.getClientCode())
                .likeIfPresent(ClientDO::getClientName, reqVO.getClientName())
                .likeIfPresent(ClientDO::getCreatedDate, reqVO.getCreatedDate())
                .eqIfPresent(ClientDO::getCalledForShort, reqVO.getCalledForShort())
                .orderByDesc(ClientDO::getId));
    }


    /**
     * 获取开启合同上传周期的客户的上传合同周期
     */
    List<ClientContractUploadCycleVO> listOpenCycleClientContractUploadCycle();

}